const db = require('../DB/index')

// 获取用户基本信息
exports.getUserinfo = (req,res)=>{
    const sql = `select * from user where username = ?`
    db.query(sql,req.user.username,(err,result)=>{
        if(err) return res.cc(err)
        if(result.length !== 1) return res.cc('获取用户信息失败')
        res.send({
            status:0,
            message:'获取用户信息成功',
            data:result[0]
        })
    })

}